.class public Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;
.super Ljava/lang/Object;
.source "SwipeBackActivityHelper.java"


# instance fields
.field private mActivity:Landroid/app/Activity;

.field private mSwipeBackLayout:Lcom/brixd/android/swipeback/lib/SwipeBackLayout;


# direct methods
.method public constructor <init>(Landroid/app/Activity;)V
    .registers 2
    .param p1, "activity"    # Landroid/app/Activity;

    .prologue
    .line 22
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 23
    iput-object p1, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mActivity:Landroid/app/Activity;

    .line 24
    return-void
.end method


# virtual methods
.method public convertActivityFromTranslucent()V
    .registers 7

    .prologue
    .line 82
    const/4 v2, 0x1

    :try_start_1
    new-array v0, v2, [Ljava/lang/Class;

    const/4 v2, 0x0

    const/4 v3, 0x0

    aput-object v3, v0, v2

    .line 83
    .local v0, "c":[Ljava/lang/Class;
    const-class v2, Landroid/app/Activity;

    const-string v3, "convertFromTranslucent"

    invoke-virtual {v2, v3, v0}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v1

    .line 84
    .local v1, "method":Ljava/lang/reflect/Method;
    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Ljava/lang/reflect/Method;->setAccessible(Z)V

    .line 85
    iget-object v2, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mActivity:Landroid/app/Activity;

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    const/4 v5, 0x0

    aput-object v5, v3, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1f
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1f} :catch_20

    .line 88
    .end local v0    # "c":[Ljava/lang/Class;
    .end local v1    # "method":Ljava/lang/reflect/Method;
    :goto_1f
    return-void

    .line 86
    :catch_20
    move-exception v2

    goto :goto_1f
.end method

.method public convertActivityToTranslucent()V
    .registers 9

    .prologue
    const/4 v4, 0x0

    .line 104
    :try_start_1
    const-class v5, Landroid/app/Activity;

    invoke-virtual {v5}, Ljava/lang/Class;->getDeclaredClasses()[Ljava/lang/Class;

    move-result-object v0

    .line 105
    .local v0, "classes":[Ljava/lang/Class;, "[Ljava/lang/Class<*>;"
    const/4 v3, 0x0

    .line 106
    .local v3, "translucentConversionListenerClazz":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
    array-length v5, v0

    :goto_9
    if-ge v4, v5, :cond_1d

    aget-object v1, v0, v4

    .line 107
    .local v1, "clazz":Ljava/lang/Class;
    invoke-virtual {v1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v6

    const-string v7, "TranslucentConversionListener"

    invoke-virtual {v6, v7}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v6

    if-eqz v6, :cond_1a

    .line 108
    move-object v3, v1

    .line 106
    :cond_1a
    add-int/lit8 v4, v4, 0x1

    goto :goto_9

    .line 111
    .end local v1    # "clazz":Ljava/lang/Class;
    :cond_1d
    const-class v4, Landroid/app/Activity;

    const-string v5, "convertToTranslucent"

    const/4 v6, 0x1

    new-array v6, v6, [Ljava/lang/Class;

    const/4 v7, 0x0

    aput-object v3, v6, v7

    invoke-virtual {v4, v5, v6}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v2

    .line 113
    .local v2, "method":Ljava/lang/reflect/Method;
    const/4 v4, 0x1

    invoke-virtual {v2, v4}, Ljava/lang/reflect/Method;->setAccessible(Z)V

    .line 114
    iget-object v4, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mActivity:Landroid/app/Activity;

    const/4 v5, 0x1

    new-array v5, v5, [Ljava/lang/Object;

    const/4 v6, 0x0

    const/4 v7, 0x0

    aput-object v7, v5, v6

    invoke-virtual {v2, v4, v5}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_3b
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_3b} :catch_3c

    .line 119
    .end local v0    # "classes":[Ljava/lang/Class;, "[Ljava/lang/Class<*>;"
    .end local v2    # "method":Ljava/lang/reflect/Method;
    .end local v3    # "translucentConversionListenerClazz":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
    :goto_3b
    return-void

    .line 117
    :catch_3c
    move-exception v4

    goto :goto_3b
.end method

.method public findViewById(I)Landroid/view/View;
    .registers 3
    .param p1, "id"    # I

    .prologue
    .line 58
    iget-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mSwipeBackLayout:Lcom/brixd/android/swipeback/lib/SwipeBackLayout;

    if-eqz v0, :cond_b

    .line 59
    iget-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mSwipeBackLayout:Lcom/brixd/android/swipeback/lib/SwipeBackLayout;

    invoke-virtual {v0, p1}, Lcom/brixd/android/swipeback/lib/SwipeBackLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    .line 61
    :goto_a
    return-object v0

    :cond_b
    const/4 v0, 0x0

    goto :goto_a
.end method

.method public getSwipeBackLayout()Lcom/brixd/android/swipeback/lib/SwipeBackLayout;
    .registers 2

    .prologue
    .line 65
    iget-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mSwipeBackLayout:Lcom/brixd/android/swipeback/lib/SwipeBackLayout;

    return-object v0
.end method

.method public onActivityCreate()V
    .registers 5

    .prologue
    const/4 v3, 0x0

    .line 28
    iget-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mActivity:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    new-instance v1, Landroid/graphics/drawable/ColorDrawable;

    const/4 v2, 0x0

    invoke-direct {v1, v2}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V

    invoke-virtual {v0, v1}, Landroid/view/Window;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 29
    iget-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mActivity:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/Window;->getDecorView()Landroid/view/View;

    move-result-object v0

    invoke-virtual {v0, v3}, Landroid/view/View;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 30
    iget-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mActivity:Landroid/app/Activity;

    invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    sget v1, Lcom/brixd/android/swipeback/lib/R$layout;->swipeback_layout:I

    invoke-virtual {v0, v1, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/brixd/android/swipeback/lib/SwipeBackLayout;

    iput-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mSwipeBackLayout:Lcom/brixd/android/swipeback/lib/SwipeBackLayout;

    .line 32
    iget-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mSwipeBackLayout:Lcom/brixd/android/swipeback/lib/SwipeBackLayout;

    new-instance v1, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper$1;

    invoke-direct {v1, p0}, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper$1;-><init>(Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;)V

    invoke-virtual {v0, v1}, Lcom/brixd/android/swipeback/lib/SwipeBackLayout;->addSwipeListener(Lcom/brixd/android/swipeback/lib/SwipeBackLayout$SwipeListener;)V

    .line 50
    return-void
.end method

.method public onPostCreate()V
    .registers 3

    .prologue
    .line 53
    iget-object v0, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mSwipeBackLayout:Lcom/brixd/android/swipeback/lib/SwipeBackLayout;

    iget-object v1, p0, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->mActivity:Landroid/app/Activity;

    invoke-virtual {v0, v1}, Lcom/brixd/android/swipeback/lib/SwipeBackLayout;->attachToActivity(Landroid/app/Activity;)V

    .line 54
    invoke-virtual {p0}, Lcom/brixd/android/swipeback/lib/activity/SwipeBackActivityHelper;->convertActivityFromTranslucent()V

    .line 55
    return-void
.end method
